﻿using System;
using System.Collections.Generic;
using HAVNet.Core.String;


namespace HAVNet.Intros.AST
{
    public class ASTTypeParam : ASTNode
    {
        public string   name { get; set; }
        public readonly ASTAttributes attributes = new ASTAttributes ();

        public ASTTypeParam()
        { }

        public ASTTypeParam(string ident)
        { this.name = ident; }

        public override string ToString()
        {
            return attributes.ToString() + name;
        }
    }

    public class ASTTypeParamList : List<ASTTypeParam>
    {
        public override string ToString ()
        {
            return (this.Count > 0) ?
                string.Format("<{0}>", Strings.joinobjs(", ", this)) :
                string.Empty;
        }
    }
}
